home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / c-tools / c_examples / appmenu / appmenu_example.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-19  |  1.4 KB  |  60 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. // AppMenu Example
  3. // 5.18.95 Deryk Robosson
  4.  
  5. //////////////////////////////////////////////////////////////////////////////
  6. // Includes
  7. #include "aframe:include/amigaapp.hpp"
  8. #include "aframe:include/window.hpp"
  9. #include "aframe:include/appmenu.hpp"
  10. #include "aframe:include/reqtools.hpp"
  11.  
  12. //////////////////////////////////////////////////////////////////////////////
  13. // ControlWindow Class Definition
  14.  
  15. class ControlWindow : public AFWindow
  16.  
  17. {
  18. public:
  19.     virtual void OnAppMenu(LPAppMessage amess);
  20.  
  21.     virtual ULONG WindowFlags();
  22.  
  23.     AFAppMenu   appmenu;
  24.  
  25. };
  26.  
  27. //////////////////////////////////////////////////////////////////////////////
  28. // ControlWindow Implementation routines
  29.  
  30. void ControlWindow::OnAppMenu(LPAppMessage amess)
  31. {
  32.     AFReqTools rt;
  33.  
  34.     if(amess->am_ID == 1)
  35.         rt.EZRequest("AFrame v.02\n\n©1995,1996 Synthetic Input\nJeffry Worth\nDeryk Robosson","Ok");
  36. }
  37.  
  38. ULONG ControlWindow::WindowFlags()
  39. {
  40.     return (AFWindow::WindowFlags() | WFLG_GIMMEZEROZERO);
  41. }
  42.  
  43. //////////////////////////////////////////////////////////////////////////////
  44. // MAIN
  45.  
  46. void main()
  47. {
  48.     AFAmigaApp theApp;
  49.     ControlWindow win;
  50.     AFRect rect(10,10,100,30);
  51.  
  52.     win.Create(&theApp,&rect,"AFrame AppMenu Example");
  53.  
  54.     win.appmenu.AddItem(&win, (UBYTE*)"About AFrame", (ULONG)1, theApp.appmsgport);
  55.  
  56.     win.RefreshGadgets();
  57.  
  58.     theApp.RunApp();
  59. }
  60.